<%@ Page Language="C#" MasterPageFile="~/pages/MasterPage.master" AutoEventWireup="true" CodeFile="CustomTourList.aspx.cs" Inherits="pages_CustomTourList" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headHolder" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="bodyHoder" Runat="Server">
<script type="text/javascript">
function redirect(){
    var url="CustomTourList.aspx?mode=det&f_loc=";
    url+=document.getElementById("<%=cmbDepLoc.ClientID %>").value;
    url+="&s_loc=";
    url+=document.getElementById("<%=cmbArvLoc.ClientID %>").value;
    window.location.href=url;
    }
</script>
   <asp:Panel ID="pnlMain" runat="server">
   <h4>Custom booking</h4>
   <hr />
    <table class="form_table">
        <tr>
            <td colspan="3">Where will you go?</td>
        </tr>
        <tr>
            <td style="width: 100px">
                First location:</td>
            <td style="width: 100px">
                <asp:DropDownList ID="cmbDepLoc" runat="server">
                </asp:DropDownList></td>
            <td style="width: 100px">
            </td>
        </tr>
        <tr>
            <td style="width: 100px">
                Second location:</td>
            <td style="width: 100px">
                <asp:DropDownList ID="cmbArvLoc" runat="server">
                </asp:DropDownList></td>
            <td style="width: 100px">
            </td>
        </tr>   
        <tr>
            <td></td>
            <td> <a href="#" onclick="redirect();" class="c_button">Go</a></td>
            <td></td>
        </tr>
    </table>
</asp:Panel>
<asp:Panel ID="pnlDetails" runat="server">

<h4>Facility list:</h4>
<hr />

    <asp:GridView ID="dgrFacility" runat="server" AutoGenerateColumns="false" CssClass="list_table">
        <Columns>
            <asp:TemplateField HeaderText="Facility">            
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Description">            
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Availability" ItemStyle-HorizontalAlign="center">
                <ItemTemplate>
                    <asp:Label ID="lblAvailability" runat="server" Text='<%#Bind("Availability") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>               
                <ItemTemplate>
                    <a href="FacilityDetails.aspx?id=<%#Eval("Id") %>">Details</a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>             
                <ItemTemplate>
                    <a href="CustomBooking.aspx?fac_id=<%#Eval("Id") %>&f_loc=<%=GetDepLoc() %>&s_loc=<%=GetArvLoc() %>">Booking</a>
                </ItemTemplate>
            </asp:TemplateField>
          
        </Columns>
    </asp:GridView>
    
</asp:Panel>
</asp:Content>

